﻿@using ChampionsLeagueBets.Domain
@using MvcContrib
@using MvcContrib.UI.Grid
@model IList<InvitedPerson>

@Html.Grid(Model).RowAttributes(data => new Hash(@class => data.IsAlternate ? "row-normal" : "row-grayed")).Columns(column =>
		{
			column.For(cust => cust.Id);
			column.For(cust => cust.UserName);
			column.For(cust => cust.FirstName);
			column.For(cust => cust.Surname);
			column.For(cust => cust.Email);
			column.For(cust => cust.Invitation.InvitingUser.FullName).Named("Zapraszający");
			column.For(cust => cust.User == null ? Html.ActionLink<InvitationsController>(c => c.Delete(cust.Id), "Usuń", new { @class = "deleteLink" }) : MvcHtmlString.Empty).Named("Usuwanie");
			column.For(cust => cust.User == null ? Html.ActionLink<InvitationsController>(c => c.Accept(cust.Id), "Akceptuj", new { @class = "acceptLink" }) : MvcHtmlString.Empty).Named("Akceptuj");
		}
		).Empty("Brak zaproszeń")